﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PolymorthPpractice
{
    class Program
    {
        static void Main(string[] args)
        {
            Parent p = new Child();
            Parent p1 = new Child2();
            Parent p2 = new Child4();
            Child4 c1 = new Child4();
            AbstractParent p3 = new Child3();

            p.DSS();
            p1.DSS();
            p2.DSS();
            p3.DSS();
            c1.DSS();

        }
    }

    abstract class AbstractParent
    {
        public abstract void DSS();
    }
    class Parent
    {
        public virtual void DSS()
        {
            Console.WriteLine("1");
        }
    }

    class Child : Parent
    {

    }

    class Child2 : Parent
    {
        public override void DSS()
        {
            Console.WriteLine("2");
        }
    }

    class Child3 : AbstractParent
    {
        public override void DSS()
        {
            Console.WriteLine("3");
        }
    }

    class Child4 : Parent
    {
        public void DSS()
        {
            Console.WriteLine("4");
        }
    }
}
